using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using CPlatePrintSys.Domain.Enums;

namespace CPlatePrintSys.Application.Converters
{
    public class UserRoleToDeleteVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is UserRole role)
            {
                // 超级管理员不能删除
                if (role == UserRole.SuperAdmin)
                {
                    return Visibility.Collapsed;
                }
            }
            return Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
} 